define(["jquery", "easy-admin"], function ($, ea) {
    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'task.user/index',
        add_url: 'task.user/add',
        edit_url: 'task.user/edit',
        evaluate_url: 'task.user/evaluate',
        delete_url: 'task.user/delete',
        export_url: 'task.user/export',
        modify_url: 'task.user/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                toolbar: ['refresh', 'export'],
                cols: [[
                    {type: 'checkbox'},
                    {field: 'task_title', title: '任务名称'},
                    {field: 'user_name', title: '认领人'},
                    {field: 'status_cn', title: '执行状态'},
                    {field: 'score', title: '得分'},
                    // {field: 'remark', title: '备注', templet: ea.table.text},
                    {field: 'claim_time', title: '认领时间'},
                    // {field: 'create_time', title: '创建时间'},
                    {
                        width: 250, title: '操作', templet: '#action-tpl',
                    },
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        evaluate: function(){
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});